# coding=utf-8
import django_filters

from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group

User = get_user_model()


class UserFilter(django_filters.FilterSet):
    username = django_filters.CharFilter(field_name='username', lookup_expr='icontains')
    is_active = django_filters.CharFilter(field_name='is_active')

    class Meta:
        model = User
        fields = ['username', 'is_active']


class GroupFilter(django_filters.FilterSet):

    class Meta:
        model = Group
        fields = '__all__'
